package cl.agrosuper.util
{
	import cl.agrosuper.vista.estilos.skins.PagedListSkin;
	
	import spark.components.List;
	import spark.layouts.TileLayout;
	import spark.layouts.TileOrientation;
	
	public class ListPaging extends List
	{
		private var customLayout:TileLayout;
		
		public function ListPaging()
		{
			super();
		}
		
		override protected function createChildren():void{
			super.createChildren();
			
			this.setStyle("skinClass", PagedListSkin);
			
			this.customLayout = new TileLayout();
			this.layout = this.customLayout;
		}
		
		override protected function commitProperties():void{
			super.commitProperties();
			
			this.pageScrollingEnabled = true;
			
			customLayout.requestedRowCount = 1;
			customLayout.columnWidth = this.width;
			customLayout.verticalGap = 0;
			customLayout.horizontalGap = 0;
			customLayout.orientation = TileOrientation.ROWS;
		}
	}
}